<?php


	  $sqlFile = "./music.sql";
      $str = file_get_contents($sqlFile);
      $str = preg_replace('/(--.*)|(\/\*(.|\s)*?\*\/)|(\n)/', '', $str);

      $list = explode(';', trim($str));


       foreach ($list as $key => $val) {
          if( empty($val) ){
              unset($list[$key]);
          }else{
              $list[$key].=';';

          }
    }
        $conn =  new mysqli("localhost","root","root");
        $rmSql = "drop database music_db";
        $conn->query($rmSql);

        if ($conn->connect_error) {
   		 die("连接失败: " . $conn->connect_error);
		}
		foreach ($list as $value) {
			if ($conn->query($value) === TRUE) {
    			echo "数据库创建成功"."<br>";
			}else {
				echo $conn->error."<br>";
			}
		}
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
    $uri = 'https://';
  } else {
    $uri = 'http://';
  }
    $uri .= $_SERVER['HTTP_HOST'];
  header('Location: ../echo/v1.0/Request/getChannelRqeuest');






		

         

